package com.atguigu.util

import com.alibaba.fastjson.{JSON, JSONObject}

/**
 * description ：json 工具类
 * author      ：剧情再美终是戏 
 * mail        : 13286520398@163.com
 * date        ：Created in 2020/3/6 16:35
 * modified By ：
 * version:    : 1.0
 */
object JsonUtil {

  /**
   * 将数据转换为 json
   *
   * @Author 剧情再美终是戏
   * @Date 2020/3/6 16:41
   * @param line
   * @return com.alibaba.fastjson.JSONObject
   * @Version 1.0
   **/
  def parseObject(line: String): JSONObject = {
    var jsonObj: JSONObject = null
    try {
      jsonObj = JSON.parseObject(line)
    } catch {
      case _ => // nothing to do
    }
    jsonObj
  }
}
